package day12;import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;/** * @Auther: sky * @Date: 2019/3/17 21:40 * @Description: */public class TestCachedThreadPool {    public static void main(String[] args) {        ExecutorService executorService = Executors.newCachedThreadPool();//      ExecutorService executorService = Executors.newFixedThreadPool(5);//      ExecutorService executorService = Executors.newSingleThreadExecutor();        for (int i = 0; i < 5; i++) {            executorService.execute(new TestRunnable());            System.out.println("************* a" + i + " *************");        }        executorService.shutdown();    }}class TestRunnable implements Runnable {    public void run() {        System.out.println(Thread.currentThread().getName() + "线程被调用了。");    }}